package demo1;

public class Main {
    public static void main(String[] args) {
        Account account = new Account("张三", 5000);

        System.out.println("初始状态: " + account.getState().getClass().getSimpleName());
        System.out.println("初始余额: " + account.getBalance());

        // 测试正常状态
        account.deposit(3000);
        System.out.println("存款3000后余额: " + account.getBalance());

        account.withdraw(6000);
        System.out.println("取款6000后余额: " + account.getBalance());
        System.out.println("当前状态: " + account.getState().getClass().getSimpleName());

        // 测试透支状态
        account.withdraw(100);
        System.out.println("透支取款100后余额: " + account.getBalance());

        account.computeInterest();
        System.out.println("计算利息后余额: " + account.getBalance());

        // 测试受限状态
        account.deposit(10000);
        System.out.println("存款10000后余额: " + account.getBalance());
        System.out.println("当前状态: " + account.getState().getClass().getSimpleName());

        account.withdraw(1);
        System.out.println("尝试取款1后余额: " + account.getBalance());
    }
}